import { Module } from 'vuex'
import RootStateTypes from '../../interface'
import LoadingStateType from './interface'

const theme: Module<LoadingStateType, RootStateTypes> = {
    namespaced: true,
    state: (): LoadingStateType => ({
        flag: false,
        full: false,
    }),
    mutations: {
        setLoading(state, payload: LoadingStateType) {
            state.flag = payload.flag
            state.full = payload.full
        },
    },
}

export default theme
